var webpack = require('webpack')
const baseUrl = 'http://demonuxtapi.dishait.cn'
const path = require('path')

function resolve (dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  chainWebpack: (config) => {
    config.resolve.alias.set('@', resolve('src'))
  },
  publicPath: './',
  lintOnSave: false,
  devServer: {
    port: 9090,
    proxy: {
      '/': {
        target: baseUrl,
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          '^/': '/'
        }
      }
    }
  }
}
